<form autocomplete="off" #createTenantForm="ngForm" (ngSubmit)="save()">
  <h1 mat-dialog-title>{{ "CreateNewTenant" | localize }}</h1>
  <mat-dialog-content>
    <div class="row-fluid">
      <div class="col-md-12">
        <mat-form-field>
          <input
            matInput
            name="TenancyName"
            [placeholder]="'TenancyName' | localize"
            [(ngModel)]="tenant.tenancyName"
            required
            minlength="2"
            maxlength="64"
          />
        </mat-form-field>
        <mat-form-field>
          <input
            matInput
            name="Name"
            [placeholder]="'Name' | localize"
            [(ngModel)]="tenant.name"
            required
            maxlength="128"
          />
        </mat-form-field>
        <mat-form-field>
          <input
            matInput
            name="ConnectionString"
            [placeholder]="'DatabaseConnectionString' | localize"
            [(ngModel)]="tenant.connectionString"
            maxlength="1024"
          />
        </mat-form-field>
        <mat-form-field>
          <input
            matInput
            name="AdminEmailAddress"
            [placeholder]="'AdminEmailAddress' | localize"
            [(ngModel)]="tenant.adminEmailAddress"
            type="email"
            pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,})+$"
            required
            maxlength="256"
          />
        </mat-form-field>
        <div class="checkbox-wrapper">
          <mat-checkbox name="IsActive" [(ngModel)]="tenant.isActive">
            {{ "IsActive" | localize }}
          </mat-checkbox>
        </div>
        <p>{{ "DefaultPasswordIs" | localize: "123qwe" }}</p>
      </div>
    </div>
  </mat-dialog-content>
  <div mat-dialog-actions align="end">
    <button mat-button type="button" [disabled]="saving" (click)="close(false)">
      {{ "Cancel" | localize }}
    </button>
    <button
      mat-flat-button
      type="submit"
      flex="15"
      color="primary"
      [disabled]="!createTenantForm.form.valid || saving"
    >
      {{ "Save" | localize }}
    </button>
  </div>
</form>
